<?php
	/**
	* @File name:	list.php
	* @Desription:	description
	* @Author:	 	jinxin<alucard.jx@gmail.com>   
	* @Date:	 	Fri Sep 16 17:00:34 CST 2011
	* @Copyright 	Copytright (c) jinxin<alucard.jx@gmail.com>
	* @version	 	$Id $
	*/
	
	class admin_poll_controller_list extends controller {
		public $o;
		public function __construct($app,$controller,$site) {
			parent::__construct($app,$controller,$site);
			$this->o =  model::factory('admin_poll_model_admin','poll');
		}
		
		public function index(){
			$cur_page = isset($_GET['page']) && (int)$_GET['page'] > 0 ? (int)$_GET['page'] : 1;
			$pagesize = 30;
			$this->attr['list'] = $this->o->getList($cur_page,$pagesize);
		}
		
		public function del(){
			$ids= $_POST['id'];
			foreach ($ids as $key => $val){
				if ((int)$val > 0) {
					$id[$key] = (int)$val;
				}
			}
			$this->o->delPoll($id);
			$this->hint('删除成功','error','/poll/list/index');
		}
	}
